<!-- LISTAGEM -->
<div ui-view="" class="ng-scope" ng-show="list"><!-- uiView:  -->
	<div ui-view="" class="ng-scope"><!-- uiView:  -->
		<div class="pageheader ng-scope">
		    <h1>Balancete</h1>
		    <div class="breadcrumb-wrapper hidden-xs">
				<span class="label">Você está aqui:</span>
				<ol class="breadcrumb">
		            <li ><a href="#/home">Home</a></li>
		            <li >Administradora</li>
		            <li >Financeiro</li>
		            <li >Movimentação</li>
		            <li class="active">Balancete - Pesquisa</li>
		            <!-- 
		            <li class="active">Blank Page</li>
		             -->
		        </ol>
			</div>
		</div>
		<div ui-view="" class="ng-scope"><!-- uiView:  -->
		    <section id="main-content" class="animated fadeInRight ng-scope">
				<div class="col-md-6" style="width: 100%">
		            <div class="panel panel-primary">
						<div class="panel-heading">
							<h3 class="panel-title">Pesquisa .: Filtros</h3>
							<div class="actions pull-right">
								<!-- <i data-fullscreen-widget="" class="fa fa-expand"></i>  -->
	 							<i data-widget-toggle="" class="fa fa-chevron-down"></i>
								<!-- <i data-widget-close="" class="fa fa-times"></i> -->
							</div>
						</div>
	                    <div class="panel-body" style="display: block;">
							<div class="panel-body">
		                        <form class="form-horizontal ng-pristine ng-valid" role="form">
									<div class="form-group">
										<label for="inputNomeCondominio" class="col-sm-2 control-label" style="padding-right: 0px;">
											Nome Condominio:
										</label>
										<div class="col-sm-10">
											<input type="search" class="form-control" id="inputNomeCondominio" placeholder="Nome Condominio" ng-model="filtro.nomeCondominio">
										</div>
	                                </div>
									<div class="form-group">
										<div class="col-sm-offset-2 col-sm-10">
											<button type="submit" class="btn btn-primary" ng-click="retrieveFilter()">Pesquisar</button>
											<!-- <button type="submit" class="btn btn-success" ng-click="create()">Novo Registro</button>  -->
										</div>
									</div>
								</form>
		                    </div>
	                    </div>
					</div>
				</div>
				<div class="col-md-6" style="width: 100%">
		            <div class="panel panel-primary">
						<div class="panel-heading">
							<h3 class="panel-title">Pesquisa .: Resultados</h3>
							<div class="actions pull-right">
								<!-- <i data-fullscreen-widget="" class="fa fa-expand"></i>  -->
	 							<i data-widget-toggle="" class="fa fa-chevron-down"></i>
								<!-- <i data-widget-close="" class="fa fa-times"></i> -->
							</div>
						</div>
	                    <div class="panel-body" style="display: block;">
							<table class="table table-striped">
								<thead>
									<tr>
										<th width="200px">Opções</th>
										<th width="100px">#</th>
										<th>
											<table width="100%">
												<tr>
													<td width="50%">Condominio</td>
													<td width="36%">Balancete</td>
													<td width="14%" align="center">Status</td>
												</tr>
											</table>
										</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="unidade in lista">
										<td  width="200px">
											<button class="btn btn-primary btn-sm" ng-click="details(unidade)">
												<span class="glyphicon glyphicon-list"></span>
												Detalhes
											</button>
											<button class="btn btn-success btn-sm" ng-click="open(unidade)" ng-show="{{ unidade.status == 'FECHADO' }}">
												<span class="glyphicon glyphicon-folder-open"></span>
												Abrir
											</button>
											<button class="btn btn-danger btn-sm" ng-click="close(unidade)" ng-show="{{ unidade.status == 'ABERTO' }}">
												<span class="glyphicon glyphicon-folder-close"></span>
												Fechar
											</button>
										</td>
										<td width="100px" style="vertical-align: middle;">{{unidade.id}}</td>
										<td style="vertical-align: middle;">
											<table width="100%">
												<tr>
													<td width="50%">{{ unidade.condominio.nome }}</td>
													<td width="36%">{{ unidade.dataVencimento }}</td>
													<td width="14%" align="center">
														<span  class="{{ unidade.status == 'ABERTO' && 'tf-receber' || 'tf-pagar' }}">
															{{ unidade.status }}
														</span>
													</td>
												</tr>
											</table>
										</td>
									</tr>
							  </tbody>
							</table>
	                    </div>
					</div>
				</div>
			</section>
		</div>
	</div>
</div>
<!-- LISTAGEM -->

<!-- DETALHE  -->
<div ui-view="" class="ng-scope" ng-hide="list"><!-- uiView:  -->
	<div ui-view="" class="ng-scope"><!-- uiView:  -->
		<div class="pageheader ng-scope">
		    <h1>Balancete</h1>
		    <div class="breadcrumb-wrapper hidden-xs">
				<span class="label">Você está aqui:</span>
				<ol class="breadcrumb">
		            <li ><a href="#/home">Home</a></li>
		            <li >Administradora</li>
		            <li >Financeiro</li>
		            <li >Movimentação</li>
		            <li class="active">Balancete - Detalhe</li>
		        </ol>
			</div>
		</div>
		<div ui-view="" class="ng-scope"><!-- uiView:  -->
		    <section id="main-content" class="animated fadeInRight ng-scope">
				<div class="col-md-6" style="width: 100%">
		            <div class="panel panel-primary">
						<div class="panel-heading">
							<h3 class="panel-title">Balancete .: Detalhe</h3>
							<div class="actions pull-right">
	 							<i data-widget-toggle="" class="fa fa-chevron-down"></i>
							</div>
						</div>

	                    <div class="panel-body" style="display: block;">
	                    	
							<h3 class="panel-title">Balancete</h3>
							<table class="table table-striped">
								<thead>
									<tr>
										<th width="100px">Opções</th>
										<th width="100px">#</th>
										<th>
											<table width="100%">
												<tr>
													<td width="50%">Condominio</td>
													<td width="36%">Balancete</td>
													<td width="14%" align="center">Status</td>
												</tr>
											</table>
										</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td width="100px" style="vertical-align: middle;">
											<button class="btn btn-primary btn-sm" ng-click="cancel()">
												<span class="glyphicon glyphicon-list"></span>
												Voltar
											</button>
										</td>
										<td width="100px" style="vertical-align: middle;">{{ balanceteDetail.balancete.id }}</td>
										<td style="vertical-align: middle;">
											<table width="100%">
												<tr>
													<td width="50%">{{ balanceteDetail.balancete.condominio.nome }}</td>
													<td width="36%">{{ balanceteDetail.balancete.dataVencimento }}</td>
													<td width="14%" align="center">
														<span  class="{{ balanceteDetail.balancete.status == 'ABERTO' && 'tf-receber' || 'tf-pagar' }}">
															{{ balanceteDetail.balancete.status }}
														</span>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</tbody>
							</table>
							
							<h3 class="panel-title tf-receber">Lançamentos a Receber</h3>
							<table class="table table-striped">
								<thead>
									<tr>
										<th width="35%">Conta</th>
										<th width="35%">Histórico</th>
										<th width="15%" align="left">Data Movimento</td>
										<th width="15%" style="text-align: right;">Valor Lançamento</td>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="lancamentoR in balanceteDetail.receber">
										<td width="35%">{{ lancamentoR.conta.nome }}</td>
										<td width="35%">{{ lancamentoR.historicoBalancete.descricao }}</td>
										<td width="15%" align="left">{{ lancamentoR.dataMovimento }}</td>
										<td width="15%" style="text-align: right;">
											<span  class="{{ lancamentoR.historicoCaixaBanco.tipoFinanceiro == 'RECEBER' && 'tf-receber' || 'tf-pagar' }}">
												R$ {{ lancamentoR.valorLancamento }}
											</span>
										</td>
									</tr>
								</tbody>
							</table>

							<h3 class="panel-title tf-pagar">Lançamentos a Pagar</h3>
							<table class="table table-striped">
								<thead>
									<tr>
										<th width="35%">Conta</th>
										<th width="35%">Histórico</th>
										<th width="15%" align="left">Data Movimento</td>
										<th width="15%" style="text-align: right;">Valor Lançamento</td>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="lancamentoP in balanceteDetail.pagar">
										<td width="35%">{{ lancamentoP.conta.nome }}</td>
										<td width="35%">{{ lancamentoP.historicoBalancete.descricao }}</td>
										<td width="15%" align="left">{{ lancamentoP.dataMovimento }}</td>
										<td width="15%" style="text-align: right;">
											<span  class="{{ lancamentoP.historicoCaixaBanco.tipoFinanceiro == 'RECEBER' && 'tf-receber' || 'tf-pagar' }}">
												R$ {{ lancamentoP.valorLancamento }}
											</span>
										</td>
									</tr>
								</tbody>
							</table>
							
	                    </div>
					</div>
				</div>
			</section>
		</div>
	</div>
</div>
<!-- FORMULARIO -->
